/*
 * @Author: your name
 * @Date: 2022-02-27 23:35:11
 * @LastEditTime: 2022-02-28 23:24:02
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \the-way-of-interview\promise.js
 */
// new Promise((resolve, reject) => {
//     console.log('new promise')
//     resolve('resolve')
// })
// console.log('finish')
// //new promise
// //finish
//

// Promise.resolve(1).then(res => {
//     console.log(res)
//     return 2
// }).then(res => {
//     console.log(res)
// })
// // 1
// // 2

new Promise(function(resolve, reject) {
    console.log('new promise')
    resolve('resolve')
})
console.log('finish')

Promise.resolve(1).then(res =>{
    console.log(res)
    return 2
}).then(res =>{
    console.log(res)
})

